<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CreateUpdateAccount.ascx.cs" Inherits="TVT.UI.UserControls.CreateUpdateAccount" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:UpdatePanel ID="upCreateUpdateAccount" runat="server" UpdateMode="Conditional">
    <ContentTemplate>        
        <table style="text-align:left;" width="100%" cellpadding="0" cellspacing="0" >
            <tr>
                <td class="style2" style="background-image:url(App_Themes/NewDesign/Images/barra-pix.gif);">
                    <img id="imgPoints" src="App_Themes/NewDesign/Images/tild-tit.gif" style="vertical-align:middle"/>
                    <font class="titleText">Accounts</font>
                </td>
                <td class="style2" align="right"  style="background-image:url(App_Themes/NewDesign/Images/barra-pix.gif);">    
                    <asp:LinkButton ID="lnkBtnCollapseCreateUpdateAccount" runat="server"><asp:Image ID="imgCollapseExpandCreateUpdateAccount" ImageUrl="~/App_Themes/NewDesign/Images/_icon.gif" runat="server" style="padding-right:10px;vertical-align:middle;" /></asp:LinkButton>
                </td>
            </tr>
        </table>        
        <asp:Panel ID="pnlCreateUpdateAccount" runat="server" Width="90%" style="text-align:left; padding-left:40px; padding-top:10px">
            <table style="text-align:left;height:50px" cellpadding="0px" cellspacing="0px" width="1010px" class="Table">   
                <tr>            
                    <td>
                        <asp:Label ID="lblTransactionResultMessage" runat="server" Visible="false" CssClass="transactionResultMessage"></asp:Label>
                        <asp:ValidationSummary ID="requiredValidator" runat="server" ValidationGroup="requiredField"  />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Panel ID="pnlAccount" runat="server" Visible="true">
                           <table>
                                <tr>
                                    <td style="width:115px">
                                        <asp:Label ID="lblAccountNumber" runat="server" CssClass="labelText" Text="Account Number:" style="margin-left:18px"></asp:Label>   
                                    </td>
                                    <td style="width:300px">
                                        <asp:TextBox ID="txtAccountNumber" runat="server" Width="100px" CssClass="TextBox"></asp:TextBox> 
                                        <asp:RequiredFieldValidator ID="rqdValidator" runat="server" ControlToValidate="txtAccountNumber" Text="*" ValidationGroup="requiredField" ErrorMessage="Must enter Account Number"></asp:RequiredFieldValidator>  
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:115px">
                                        <asp:Label ID="lblAccountInterest" runat="server" CssClass="labelText" Text="Interest:" style="margin-left:18px"></asp:Label>   
                                    </td>
                                    <td style="width:300px">
                                        <asp:TextBox ID="txtAccountInterest" runat="server" Width="100px" CssClass="TextBox"></asp:TextBox> 
                                        <asp:RequiredFieldValidator ID="rqdInterestValidator" runat="server" ControlToValidate="txtAccountInterest" Text="*" ValidationGroup="requiredField" ErrorMessage="Must enter an Interest"></asp:RequiredFieldValidator>  
                                        <asp:RangeValidator ID="rvAccountInterest" MinimumValue="0" MaximumValue="1"
                                            Type="Double" ControlToValidate="txtAccountInterest" Text="*" runat="server" ValidationGroup="requiredField"
                                            ErrorMessage="Must enter a decimal number between 0 and 1 for Interest" >
                                        </asp:RangeValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width:115px">
                                        <asp:Label ID="lblCompany" runat="server" CssClass="labelText" Text="Company:" style="margin-left:18px"></asp:Label>   
                                    </td>
                                     <td style="width:300px">
                                        <asp:DropDownList ID="ddlCompany" runat="server" Width="100px" CssClass="TextBox" AutoPostBack="true"></asp:DropDownList> 
                                     </td>                                     
                                </tr>                                   
                                <tr>
                                    <td style="width:115px">
                                        <asp:Label ID="lblClearing" runat="server" CssClass="labelText" Text="Clearing:" style="margin-left:18px"></asp:Label>
                                    </td>
                                     <td style="width:300px">
                                        <asp:DropDownList ID="ddlClearing" runat="server" Width="100px" CssClass="TextBox" AutoPostBack="true"></asp:DropDownList> 
                                     </td>                                     
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
            <table width="100%" style="text-align:center">
                <tr>
                    <td >
                        <asp:Button id="btnSubmit" runat="server" style="background-image:url(App_Themes/NewDesign/Images/btn-SubmitBlue.gif);cursor:pointer" CssClass="Button" Text="SUBMIT" ValidationGroup="requiredField" OnClick="SaveAccount"/>                               
                        <asp:Button id="btnCancel" runat="server" style="background-image:url(App_Themes/NewDesign/Images/btn-SubmitBlue.gif);cursor:pointer" CssClass="Button" Text="CANCEL" OnClick="CancelAccount" />                                    
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <ajaxToolkit:CollapsiblePanelExtender ID="collapsibleCreateUpdateAccount" runat="server"
            TargetControlID="pnlCreateUpdateAccount"
            CollapsedSize="0"
            Collapsed="False"
            ExpandControlID="lnkBtnCollapseCreateUpdateAccount"
            CollapseControlID="lnkBtnCollapseCreateUpdateAccount"
            AutoCollapse="False"
            AutoExpand="False"
            ImageControlID="imgCollapseExpandCreateUpdateAccount"
            ExpandedImage="~/App_Themes/NewDesign/Images/_icon.gif"
            CollapsedImage="~/App_Themes/NewDesign/Images/+icon.gif"
            ExpandDirection="Vertical" />
     </ContentTemplate>
</asp:UpdatePanel>